#ifndef COREMESH_H
#define COREMESH_H

#include <vector>
#include <map>
#include "framework.h"
#include "coldet/coldet.h"

class coreMesh
{
public:
	std::vector< Vector3 > vertices; //here we store the vertices
	std::vector< Vector3 > normals;	 //here we store the normals
	std::vector< Vector2 > uvs;	 //here we store the texture coordinates
	double dataSize;
	bool multiTexture;
	std::vector<std::string> texturesID;
	std::vector<int> texturesOffset;
	//we can store the indices or we can skip them and store the mesh uncompressed (without indexing)
	std::vector< Vector3u > indices;	 //here we store the indices
	Vector3 media, lejano;
	CollisionModel3D * colmodel;
	std::string coreID;

	void clear();
	void render();
	void renderDebug();
	void addQuad(Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4, Vector3 color);
	void createCube(float size);
	bool parseAse(std::string file);
	float Distancia(Vector3 a, Vector3 b);

private:
	void DumpToFile();
	void ReadDumpedFile();
};

#endif